// Code Behind for propertyddialog.mxml
        import jcrweb.as3.FlexUtil;
        import jcrweb.as3.RequestUtil;
        
        import mx.controls.Alert;
        import mx.managers.PopUpManager;
        import jcrweb.as3.LanguageUtil;
		[Bindable]
	    private var languageUtil:LanguageUtil;
		[Bindable]
		private var strPath:String = "";
		[Bindable]
		private var strPathName:String = "";
		[Bindable]
		private var strId:String = "";
		
		private var strName:String = "";
		private var strNote:String = "";
		private var strDate:String = "";
		[Bindable]
		[Embed(source='../WebContent/images/error.gif')]
		private var iconError:Class;
		
        private function init():void {
		    languageUtil = LanguageUtil.getInstance();
	    }

		public function setId(strId:String):void{
			this.strId = strId;
		}
		public function setPath(path:String):void{
			this.strPath = path;
		}
		public function setPathName(pathName:String):void{
			this.strPathName = pathName;
		}
		public function setName(inputStr:String):void{
			input_name.text = inputStr;
			strName = inputStr;
		}
		public function setCreaterCode(inputStr:String):void{
			input_createrCode.text = inputStr;
		}
		public function setCreaterName(inputStr:String):void{
			input_createrName.text = inputStr;
		}
		public function setDatetime(inputStr:String):void{
			input_datetime.text = inputStr;
			strDate = inputStr;
		}
		public function setNote(inputStr:String):void{
			input_note.text = inputStr;
			strNote = inputStr;
		}	
		private function reset():void{
			input_name.text = strName;
			input_note.text = strNote;
			input_datetime.text = strDate;
		}	
		private function delData():void{
			var para:String = new String();
			para +="&id="+this.strId;
			para +="&path="+input_path.text;
			//Alert.show(url);
			para =  encodeURI(para);
			para =  encodeURI(para);
			var url:String = RequestUtil.DELETEDIR_URL+para;
			RequestUtil.sendRequest(url,Event.COMPLETE,complete);
		}
		private function submit():void{
			var para:String = new String();
			para +="&id="+this.strId;
			para +="&path="+input_path.text;
			para +="&name="+input_name.text;
			para +="&createrCode="+input_createrCode.text;
			para +="&createrName="+input_createrName.text;
			para +="&datetime="+input_datetime.text;
			para +="&note="+input_note.text;
			para =  encodeURI(para);
			para =  encodeURI(para);	
			var url:String = RequestUtil.UPDATEDIR_URL+para;
			RequestUtil.sendRequest(url,Event.COMPLETE,complete);
		}

		private function complete(event:Event):void {
			var loader:URLLoader = URLLoader(event.target); 
			var isError:String = FlexUtil.getTag(loader.data,FlexUtil.IS_ERROR);
			if(isError == "true" ){
				var errorMes:String = FlexUtil.getTag(loader.data,FlexUtil.ERROR_MES_TAG);
				Alert.show("Faild!"+errorMes,"Error",0,null,null,iconError);
			}
			closeDialog();
		}
		private function closeDialog():void{
			PopUpManager.removePopUp(this);
		}
		private function keyDownEvent(keyCode:uint):void{
			if(keyCode == 27){
				this.closeDialog();
			}
		}